package com.hsc.yalebao.tabDongTai;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.res.Resources;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;
import android.support.v4.view.ViewPager.OnPageChangeListener;
import android.text.format.DateUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import com.google.gson.Gson;
import com.handmark.pulltorefresh.library.ILoadingLayout;
import com.handmark.pulltorefresh.library.PullToRefreshBase;
import com.handmark.pulltorefresh.library.PullToRefreshBase.Mode;
import com.handmark.pulltorefresh.library.PullToRefreshBase.OnRefreshListener;
import com.handmark.pulltorefresh.library.PullToRefreshListView;
import com.hsc.yalebao.adapter.AdvViewPagerAdapter;
import com.hsc.yalebao.adapter.DongTaiMessageListViewAdapter;
import com.hsc.yalebao.base.ActivityStack;
import com.hsc.yalebao.base.BaseFragment;
import com.hsc.yalebao.base.CustomApplication;
import com.hsc.yalebao.base.MainActivity;
import com.hsc.yalebao.http.AppConstants;
import com.hsc.yalebao.http.RequestNet;
import com.hsc.yalebao.model.AvdBaseModel;
import com.hsc.yalebao.model.AvdModel;
import com.hsc.yalebao.model.MessageTitleBean;
import com.hsc.yalebao.model.MessageTitleBean.ResultBean;
import com.hsc.yalebao.model.UserBaseBean;
import com.hsc.yalebao.tabIndex.IndexFragment;
import com.hsc.yalebao.tabMine.DetailMessageActivity;
import com.hsc.yalebao.tools.DateUtil;
import com.hsc.yalebao.tools.NoDoubleClickUtils;
import com.hsc.yalebao.tools.UiUtil;
import com.hsc.yalebao.weight.LogUtils;
import com.zhy.http.okhttp.callback.StringCallback;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Timer;
import java.util.TimerTask;
import okhttp3.Call;

@SuppressLint({"NewApi"})
public class DongTaiFragment<E> extends BaseFragment
  implements View.OnClickListener
{
  public static DongTaiFragment fragment;
  private boolean IsMy;
  private String MsgType = "tongzhi";
  private String TAG = "-DongTaiFragment-";
  DongTaiMessageListViewAdapter adapter;
  private View contentView;
  private int currentItem = 0;
  private ArrayList<ImageView> dot_view;
  private View emptyView;
  private Handler handler = new Handler()
  {
    public void handleMessage(Message paramAnonymousMessage)
    {
      if ((DongTaiFragment.this.viewPager != null) && (DongTaiFragment.this.pic_ids != null) && (DongTaiFragment.this.pic_ids.size() != 0))
      {
        DongTaiFragment.this.currentItem = ((1 + DongTaiFragment.this.viewPager.getCurrentItem()) % DongTaiFragment.this.pic_ids.size());
        DongTaiFragment.this.viewPager.setCurrentItem(DongTaiFragment.this.currentItem);
      }
      LogUtils.i(DongTaiFragment.this.TAG, "currentItem:" + DongTaiFragment.this.currentItem);
    }
  };
  public ImageView img_gonggao_msg;
  private ImageView img_xiaoxitixing;
  private boolean isEnd = false;
  private boolean isRunning = true;
  private boolean isgonggao;
  private LinearLayout layout_dots;
  private PullToRefreshListView listview;
  private LinearLayout ll_mymsg;
  private LinearLayout ll_tongzhi;
  private MainActivity mainActivity;
  private int memberid;
  private ArrayList<MessageTitleBean.ResultBean> messageList;
  int oldPosition = 0;
  private int page = 1;
  private AdvViewPagerAdapter pagerAdapter;
  private ArrayList<AvdBaseModel> pic_ids;
  private Resources resources = null;
  private Timer timer = new Timer();
  private DongTaiFragment<E>.AdvTimerTask timerTask;
  private TextView tv_mymsg;
  private TextView tv_tishi;
  private TextView tv_tongzhi;
  private ViewPager viewPager;
  private ImageView view_mymsg_xian;
  private ImageView view_tongzhi_xian;

  private void init()
  {
    this.pic_ids = new ArrayList();
    this.dot_view = new ArrayList();
    if ((IndexFragment.fragment.pic_ids != null) && (IndexFragment.fragment.pic_ids.size() != 0))
      this.pic_ids = IndexFragment.fragment.pic_ids;
    this.layout_dots = ((LinearLayout)this.contentView.findViewById(2131100033));
    this.ll_tongzhi = ((LinearLayout)this.contentView.findViewById(2131100092));
    this.ll_mymsg = ((LinearLayout)this.contentView.findViewById(2131100095));
    this.ll_tongzhi.setOnClickListener(fragment);
    this.ll_mymsg.setOnClickListener(fragment);
    this.tv_tongzhi = ((TextView)this.contentView.findViewById(2131100093));
    this.tv_mymsg = ((TextView)this.contentView.findViewById(2131100096));
    this.view_tongzhi_xian = ((ImageView)this.contentView.findViewById(2131100098));
    this.view_mymsg_xian = ((ImageView)this.contentView.findViewById(2131100099));
    this.img_xiaoxitixing = ((ImageView)this.contentView.findViewById(2131100097));
    this.view_tongzhi_xian.setBackgroundColor(fragment.getResources().getColor(2131165336));
    this.img_gonggao_msg = ((ImageView)this.contentView.findViewById(2131100094));
    this.viewPager = ((ViewPager)this.contentView.findViewById(2131100090));
    if (this.pagerAdapter == null)
    {
      this.pagerAdapter = new AdvViewPagerAdapter(this.pic_ids, getActivity());
      this.pagerAdapter.notifyDataSetChanged();
    }
    this.viewPager.setAdapter(this.pagerAdapter);
    initDotsAndMakeStart();
    this.viewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener()
    {
      public void onPageScrollStateChanged(int paramAnonymousInt)
      {
        LogUtils.d("onPageScrollStateChanged", "arg0:" + paramAnonymousInt);
      }

      public void onPageScrolled(int paramAnonymousInt1, float paramAnonymousFloat, int paramAnonymousInt2)
      {
      }

      public void onPageSelected(int paramAnonymousInt)
      {
        if (DongTaiFragment.this.isRunning)
        {
          LogUtils.i(DongTaiFragment.this.TAG, "position:" + paramAnonymousInt);
          ((ImageView)DongTaiFragment.this.dot_view.get(DongTaiFragment.this.oldPosition)).setImageDrawable(DongTaiFragment.this.getActivity().getResources().getDrawable(2130838124));
          ((ImageView)DongTaiFragment.this.dot_view.get(paramAnonymousInt)).setImageDrawable(DongTaiFragment.this.getActivity().getResources().getDrawable(2130838125));
          DongTaiFragment.this.oldPosition = paramAnonymousInt;
        }
      }
    });
    this.listview = ((PullToRefreshListView)this.contentView.findViewById(2131099717));
    this.messageList = new ArrayList();
    if (this.adapter == null)
    {
      this.adapter = new DongTaiMessageListViewAdapter(this.messageList, getActivity());
      this.adapter.setData(this.messageList);
      this.adapter.notifyDataSetChanged();
    }
    this.listview.setAdapter(this.adapter);
    this.emptyView = LayoutInflater.from(getActivity()).inflate(2130903139, null);
    this.tv_tishi = ((TextView)this.emptyView.findViewById(2131100053));
    this.tv_tishi.setText("获取中...");
    this.listview.setOnItemClickListener(new AdapterView.OnItemClickListener()
    {
      public void onItemClick(AdapterView<?> paramAnonymousAdapterView, View paramAnonymousView, int paramAnonymousInt, long paramAnonymousLong)
      {
        while (true)
        {
          Intent localIntent;
          try
          {
            if (NoDoubleClickUtils.isDoubleClick())
              return;
            int i = paramAnonymousInt - 1;
            localIntent = new Intent(DongTaiFragment.this.getActivity(), DetailMessageActivity.class);
            MessageTitleBean.ResultBean localResultBean = (MessageTitleBean.ResultBean)DongTaiFragment.this.messageList.get(i);
            if ("tongzhi".equals(DongTaiFragment.this.MsgType))
            {
              localIntent.putExtra("MsgType", "tongzhi");
              localIntent.putExtra("message", localResultBean);
              DongTaiFragment.this.startActivity(localIntent);
              localResultBean.IsRead = "1";
              if (DongTaiFragment.this.adapter != null)
                DongTaiFragment.this.adapter.notifyDataSetChanged();
              if (!DongTaiFragment.this.isgonggao)
                break;
              DongTaiFragment.this.getActivity();
              SharedPreferences localSharedPreferences = DongTaiFragment.this.getActivity().getSharedPreferences("date", 0);
              String str1 = localSharedPreferences.getString("gonggao", "");
              SharedPreferences.Editor localEditor = localSharedPreferences.edit();
              String str2 = ((MessageTitleBean.ResultBean)DongTaiFragment.this.messageList.get(i)).Id;
              if (str1.contains(str2))
                break;
              localEditor.putString("gonggao", str1 + str2 + ",");
              localEditor.commit();
              String str3 = localSharedPreferences.getString("gonggao", "");
              LogUtils.e(DongTaiFragment.this.TAG, "nowold---" + str3);
              return;
            }
          }
          catch (Exception localException)
          {
            localException.printStackTrace();
            return;
          }
          localIntent.putExtra("MsgType", "mymsg");
        }
      }
    });
    initRefresh();
  }

  private void initDotsAndMakeStart()
  {
    if ((this.pic_ids != null) && (this.pic_ids.size() > 0))
    {
      if (this.timerTask != null)
      {
        this.timerTask.cancel();
        this.timerTask = null;
      }
      if (this.layout_dots != null)
      {
        this.layout_dots.removeAllViews();
        this.layout_dots.setVisibility(8);
      }
      if ((this.dot_view != null) && (this.dot_view.size() != 0))
        this.dot_view.clear();
    }
    for (int i = 0; ; i++)
    {
      if (i >= this.pic_ids.size())
      {
        this.pagerAdapter.pic_ids = this.pic_ids;
        this.pagerAdapter.notifyDataSetChanged();
        this.timerTask = new AdvTimerTask();
        this.timer.scheduleAtFixedRate(this.timerTask, 0L, 4000L);
        return;
      }
      ImageView localImageView = new ImageView(getActivity());
      localImageView.setImageDrawable(getActivity().getResources().getDrawable(2130838124));
      this.dot_view.add(localImageView);
      this.layout_dots.addView(localImageView);
      this.layout_dots.setVisibility(0);
    }
  }

  private void initRefresh()
  {
    this.listview.setMode(PullToRefreshBase.Mode.BOTH);
    this.listview.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener()
    {
      public void onRefresh(PullToRefreshBase<ListView> paramAnonymousPullToRefreshBase)
      {
        String str = DateUtils.formatDateTime(DongTaiFragment.this.getActivity(), System.currentTimeMillis(), 524305);
        paramAnonymousPullToRefreshBase.getLoadingLayoutProxy().setLastUpdatedLabel(str);
        if (DongTaiFragment.this.listview.isHeaderShown())
        {
          LogUtils.e(DongTaiFragment.this.TAG, "mPullRefreshListView刷新");
          DongTaiFragment.this.page = 1;
          if (DongTaiFragment.this.IsMy)
          {
            DongTaiFragment.this.getMessageTitle(false, 2);
            return;
          }
          DongTaiFragment.this.getMessageTitle(false, 1);
          return;
        }
        LogUtils.e(DongTaiFragment.this.TAG, "mPullRefreshListView加载");
        DongTaiFragment localDongTaiFragment = DongTaiFragment.this;
        localDongTaiFragment.page = (1 + localDongTaiFragment.page);
        if (DongTaiFragment.this.IsMy)
        {
          DongTaiFragment.this.getMessageTitle(true, 2);
          return;
        }
        DongTaiFragment.this.getMessageTitle(true, 1);
      }
    });
  }

  private void setBtnColor(boolean paramBoolean)
  {
    if (paramBoolean)
    {
      this.tv_mymsg.setTextColor(fragment.getResources().getColor(2131165336));
      this.tv_tongzhi.setTextColor(fragment.getResources().getColor(2131165395));
      this.view_mymsg_xian.setBackgroundColor(fragment.getResources().getColor(2131165336));
      this.view_tongzhi_xian.setBackgroundColor(fragment.getResources().getColor(2131165341));
      return;
    }
    this.tv_tongzhi.setTextColor(fragment.getResources().getColor(2131165336));
    this.tv_mymsg.setTextColor(fragment.getResources().getColor(2131165395));
    this.view_mymsg_xian.setBackgroundColor(fragment.getResources().getColor(2131165341));
    this.view_tongzhi_xian.setBackgroundColor(fragment.getResources().getColor(2131165336));
  }

  public void getBanners()
  {
    HashMap localHashMap = new HashMap();
    localHashMap.put("Type", "0");
    localHashMap.put("num", "10");
    RequestNet.get(getActivity(), AppConstants.URL_GET_AD_LIST, localHashMap, new StringCallback()
    {
      public void onError(Call paramAnonymousCall, Exception paramAnonymousException)
      {
        LogUtils.e(DongTaiFragment.this.TAG, "获取失败,获取banner:" + paramAnonymousException);
      }

      public void onResponse(String paramAnonymousString)
      {
        LogUtils.d(DongTaiFragment.this.TAG, "result:" + paramAnonymousString);
        Gson localGson = new Gson();
        try
        {
          localAvdModel = (AvdModel)localGson.fromJson(paramAnonymousString, AvdModel.class);
          if (localAvdModel == null)
          {
            LogUtils.e(DongTaiFragment.this.TAG, "获取失败");
            return;
          }
        }
        catch (Exception localException)
        {
          AvdModel localAvdModel;
          do
          {
            while (true)
            {
              localException.printStackTrace();
              localAvdModel = null;
            }
            if (localAvdModel.getFlag() == -4)
            {
              ActivityStack.getInstance().backToMain(MainActivity.class, DongTaiFragment.this.getActivity());
              return;
            }
            if (localAvdModel.getFlag() == 0)
            {
              UiUtil.showToast(DongTaiFragment.this.getActivity(), localAvdModel.getMsg());
              return;
            }
            if (localAvdModel.getFlag() == -2)
            {
              MainActivity.mainActivity.showOffLineDialog();
              return;
            }
            if (localAvdModel.getFlag() == -3)
            {
              MainActivity.mainActivity.showFengjinDialog();
              return;
            }
          }
          while (localAvdModel.getFlag() != 1);
          DongTaiFragment.this.pic_ids = localAvdModel.getResult();
          DongTaiFragment.this.initDotsAndMakeStart();
        }
      }
    });
  }

  public void getDataFromServer()
  {
    if ((this.IsMy) && (CustomApplication.app.isLogin))
      getMessageTitle(false, 2);
    while (true)
    {
      getHasNoRead(this.img_xiaoxitixing);
      getBanners();
      return;
      getMessageTitle(false, 1);
    }
  }

  public void getHasNoRead(final ImageView paramImageView)
  {
    if (!CustomApplication.app.isLogin)
      return;
    HashMap localHashMap = new HashMap();
    localHashMap.put("memberid", CustomApplication.app.userBaseBean.getMemberid());
    localHashMap.put("isread", "0");
    localHashMap.put("page", "1");
    localHashMap.put("pagesize", "10");
    localHashMap.put("type", "2");
    LogUtils.d(this.TAG, "URL:" + AppConstants.URL_USER_GETMESSAGELIST + ",memberid=" + this.memberid);
    RequestNet.get(getActivity(), AppConstants.URL_USER_GETMESSAGELIST, localHashMap, new StringCallback()
    {
      public void onError(Call paramAnonymousCall, Exception paramAnonymousException)
      {
        LogUtils.e(DongTaiFragment.this.TAG, "获取失败,getMessageTitle-result:" + paramAnonymousException);
      }

      public void onResponse(String paramAnonymousString)
      {
        if ((paramAnonymousString == null) || ("".equals(paramAnonymousString)))
          LogUtils.e(DongTaiFragment.this.TAG, "result:" + paramAnonymousString);
        MessageTitleBean localMessageTitleBean;
        do
        {
          return;
          LogUtils.i(DongTaiFragment.this.TAG, "服务器返回未读消息=" + paramAnonymousString);
          Gson localGson = new Gson();
          try
          {
            localMessageTitleBean = (MessageTitleBean)localGson.fromJson(paramAnonymousString, MessageTitleBean.class);
            if (localMessageTitleBean == null)
            {
              LogUtils.e(DongTaiFragment.this.TAG, "getMessageTitle == null，获取失败");
              return;
            }
          }
          catch (Exception localException)
          {
            while (true)
            {
              localException.printStackTrace();
              localMessageTitleBean = null;
            }
            if (localMessageTitleBean.flag == -4)
            {
              ActivityStack.getInstance().backToMain(MainActivity.class, DongTaiFragment.this.getActivity());
              return;
            }
            System.out.println("获取flag=" + localMessageTitleBean.flag);
            if (localMessageTitleBean.flag == -2)
            {
              MainActivity.mainActivity.showOffLineDialog();
              return;
            }
            if (localMessageTitleBean.flag == -3)
            {
              MainActivity.mainActivity.showFengjinDialog();
              return;
            }
          }
        }
        while (localMessageTitleBean.flag != 1);
        if (localMessageTitleBean.total > 0)
        {
          paramImageView.setVisibility(0);
          LogUtils.e(DongTaiFragment.this.TAG, "有未读消息=" + localMessageTitleBean.total);
          return;
        }
        paramImageView.setVisibility(8);
        LogUtils.e(DongTaiFragment.this.TAG, "没有未读消息=" + localMessageTitleBean.total);
      }
    });
  }

  public void getMessageTitle(final boolean paramBoolean, final int paramInt)
  {
    HashMap localHashMap = new HashMap();
    if ((this.IsMy) && (CustomApplication.app.isLogin))
      localHashMap.put("memberid", CustomApplication.app.userBaseBean.memberid);
    localHashMap.put("isread", "-1");
    localHashMap.put("page", this.page);
    localHashMap.put("pagesize", "10");
    localHashMap.put("type", paramInt);
    if (paramInt == 1);
    for (this.isgonggao = true; ; this.isgonggao = false)
    {
      LogUtils.d(this.TAG, "URL:" + AppConstants.URL_USER_GETMESSAGELIST);
      MainActivity.mainActivity.showLoadingDialog();
      RequestNet.get(getActivity(), AppConstants.URL_USER_GETMESSAGELIST, localHashMap, new StringCallback()
      {
        public void onError(Call paramAnonymousCall, Exception paramAnonymousException)
        {
          MainActivity.mainActivity.dismissLoadingDialog();
          DongTaiFragment.this.listview.onRefreshComplete();
          LogUtils.e(DongTaiFragment.this.TAG, "获取失败,getMessageTitle-result:" + paramAnonymousException);
          if (DongTaiFragment.this.messageList != null)
            DongTaiFragment.this.messageList.clear();
          try
          {
            DongTaiFragment.this.tv_tishi.setText("获取失败");
            DongTaiFragment.this.listview.setEmptyView(DongTaiFragment.this.emptyView);
            return;
          }
          catch (Exception localException)
          {
          }
        }

        public void onResponse(String paramAnonymousString)
        {
          MainActivity.mainActivity.dismissLoadingDialog();
          DongTaiFragment.this.listview.onRefreshComplete();
          if ((paramAnonymousString == null) || ("".equals(paramAnonymousString)))
          {
            LogUtils.e(DongTaiFragment.this.TAG, "result:" + paramAnonymousString);
            DongTaiFragment.this.tv_tishi.setText("获取失败");
            DongTaiFragment.this.listview.setEmptyView(DongTaiFragment.this.emptyView);
          }
          while (true)
          {
            return;
            Gson localGson = new Gson();
            MessageTitleBean localMessageTitleBean;
            try
            {
              localMessageTitleBean = (MessageTitleBean)localGson.fromJson(paramAnonymousString, MessageTitleBean.class);
              if (localMessageTitleBean == null)
              {
                LogUtils.e(DongTaiFragment.this.TAG, "getMessageTitle == null，获取失败");
                DongTaiFragment.this.tv_tishi.setText("获取失败");
                DongTaiFragment.this.listview.setEmptyView(DongTaiFragment.this.emptyView);
                return;
              }
            }
            catch (Exception localException1)
            {
              while (true)
              {
                localException1.printStackTrace();
                localMessageTitleBean = null;
              }
              if (localMessageTitleBean.flag == -4)
              {
                if (paramInt == 1)
                  continue;
                ActivityStack.getInstance().backToMain(MainActivity.class, DongTaiFragment.this.getActivity());
                return;
              }
              if (localMessageTitleBean.flag == 0)
              {
                DongTaiFragment.this.tv_tishi.setText("暂无消息");
                DongTaiFragment.this.listview.setEmptyView(DongTaiFragment.this.emptyView);
                return;
              }
              if (localMessageTitleBean.flag == -2)
              {
                MainActivity.mainActivity.showOffLineDialog();
                return;
              }
              if (localMessageTitleBean.flag == -3)
              {
                MainActivity.mainActivity.showFengjinDialog();
                return;
              }
            }
            if (localMessageTitleBean.flag != 1)
              continue;
            DongTaiFragment.this.youmeiyouweiduxiaoxi();
            LogUtils.e(DongTaiFragment.this.TAG, "issueListBean.result == 1");
            if (localMessageTitleBean.result == null)
            {
              LogUtils.e(DongTaiFragment.this.TAG, "issueListBean.result == null");
              DongTaiFragment.this.tv_tishi.setText("暂无消息");
              DongTaiFragment.this.listview.setEmptyView(DongTaiFragment.this.emptyView);
              return;
            }
            label412: int i;
            if (paramBoolean)
              if ((DongTaiFragment.this.messageList != null) && (localMessageTitleBean.result.size() > 0))
              {
                DongTaiFragment.this.messageList.addAll(localMessageTitleBean.result);
                if (localMessageTitleBean.result.size() < 10)
                  DongTaiFragment.this.isEnd = true;
              }
              else
              {
                i = 0;
                if ((i >= DongTaiFragment.this.messageList.size()) && (DongTaiFragment.this.messageList.size() != 0));
              }
            try
            {
              DongTaiFragment.this.tv_tishi.setText("暂无消息");
              DongTaiFragment.this.listview.setEmptyView(DongTaiFragment.this.emptyView);
              if (DongTaiFragment.this.adapter == null)
                continue;
              DongTaiFragment.this.adapter.setData(DongTaiFragment.this.messageList);
              DongTaiFragment.this.adapter.notifyDataSetChanged();
              return;
              DongTaiFragment.this.isEnd = false;
              break label412;
              if (DongTaiFragment.this.messageList != null)
                DongTaiFragment.this.messageList.clear();
              DongTaiFragment.this.messageList = localMessageTitleBean.result;
              break label412;
              String str1 = DongTaiFragment.this.TAG;
              StringBuilder localStringBuilder = new StringBuilder("id");
              LogUtils.e(str1, ((MessageTitleBean.ResultBean)DongTaiFragment.this.messageList.get(i)).Id);
              if (DongTaiFragment.this.isgonggao)
              {
                Date localDate1 = new Date();
                Date localDate2 = DateUtil.getDateBefore(localDate1, 5);
                if (DateUtil.isInDate(DateUtil.getDateFromTimeString(((MessageTitleBean.ResultBean)DongTaiFragment.this.messageList.get(i)).Add_Time, "yyyy-MM-dd HH:mm:ss"), localDate2, localDate1))
                {
                  SharedPreferences localSharedPreferences1 = DongTaiFragment.this.getActivity().getSharedPreferences("dicos", 0);
                  SharedPreferences.Editor localEditor1 = localSharedPreferences1.edit();
                  String str2 = localSharedPreferences1.getString("weidugonggao", "");
                  String str3 = ((MessageTitleBean.ResultBean)DongTaiFragment.this.messageList.get(i)).Id;
                  if (!str2.contains(str3))
                  {
                    localEditor1.putString("weidugonggao", str2 + str3 + ",");
                    localEditor1.commit();
                  }
                }
              }
              while (true)
              {
                i++;
                break;
                if (!DongTaiFragment.this.isgonggao)
                {
                  SharedPreferences localSharedPreferences2 = DongTaiFragment.this.getActivity().getSharedPreferences("myself", 0);
                  SharedPreferences.Editor localEditor2 = localSharedPreferences2.edit();
                  String str4 = localSharedPreferences2.getString("myselfmsg", "");
                  String str5 = ((MessageTitleBean.ResultBean)DongTaiFragment.this.messageList.get(i)).Id;
                  if (!str4.contains(str5))
                  {
                    localEditor2.putString("myselfmsg", str4 + str5 + ",");
                    localEditor2.commit();
                  }
                }
              }
            }
            catch (Exception localException2)
            {
              while (true)
                localException2.printStackTrace();
            }
          }
        }
      });
      return;
    }
  }

  public void onActivityCreated(Bundle paramBundle)
  {
    super.onActivityCreated(paramBundle);
  }

  @SuppressLint({"ResourceAsColor"})
  public void onClick(View paramView)
  {
    switch (paramView.getId())
    {
    case 2131100093:
    case 2131100094:
    default:
      return;
    case 2131100092:
      this.MsgType = "tongzhi";
      this.IsMy = false;
      setBtnColor(this.IsMy);
      this.page = 1;
      getMessageTitle(false, 1);
      youmeiyouweiduxiaoxi();
      return;
    case 2131100095:
    }
    this.MsgType = "mymsg";
    this.page = 1;
    this.IsMy = true;
    setBtnColor(this.IsMy);
    getMessageTitle(false, 2);
    youmeiyouweiduxiaoxi();
  }

  public void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    fragment = this;
  }

  public View onCreateView(LayoutInflater paramLayoutInflater, ViewGroup paramViewGroup, Bundle paramBundle)
  {
    this.contentView = paramLayoutInflater.inflate(2130903125, null);
    init();
    return this.contentView;
  }

  public void onDestroy()
  {
    super.onDestroy();
    this.isRunning = false;
    if (this.timer != null)
    {
      this.timer.cancel();
      this.timer = null;
    }
    if (this.timerTask != null)
    {
      this.timerTask.cancel();
      this.timerTask = null;
    }
  }

  public void onResume()
  {
    super.onResume();
    if (CustomApplication.app.userBaseBean != null)
      this.memberid = CustomApplication.app.userBaseBean.getMemberid();
    if (!CustomApplication.app.isLogin)
    {
      this.MsgType = "tongzhi";
      this.IsMy = false;
      setBtnColor(this.IsMy);
      this.page = 1;
      getMessageTitle(false, 1);
    }
    getDataFromServer();
    youmeiyouweiduxiaoxi();
  }

  public void youmeiyouweiduxiaoxi()
  {
    getActivity();
    String str = getActivity().getSharedPreferences("date", 0).getString("gonggao", "");
    int i = getActivity().getSharedPreferences("dicos", 0).getString("weidugonggao", "").length();
    if (str.length() < i)
    {
      this.img_gonggao_msg.setVisibility(0);
      return;
    }
    this.img_gonggao_msg.setVisibility(4);
  }

  class AdvTimerTask extends TimerTask
  {
    AdvTimerTask()
    {
    }

    public void run()
    {
      DongTaiFragment.this.handler.sendEmptyMessage(0);
    }
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.hsc.yalebao.tabDongTai.DongTaiFragment
 * JD-Core Version:    0.6.2
 */